#ifndef SESSION_HPP
#define SESSION_HPP
#include "../../lib/protocol.hpp"
#include <string>
#include <vector>

using namespace pipc;

class Session
{
public:
    Session(int sockfd);
    ~Session();
    int getSock();
    bool isOk();
    std::string getName();
    bool write(CmdHeader header, std::vector <std::string> args);
    CmdHeader readHeader();
    std::vector <std::string> readArgs(int size);
private:
    int sockfd_;
    std::string name_;
    bool ok_;
};

#endif // SESSION_HPP
